1 00:00:00,990 --> 00:00:06,930 ‫In this year, we are going to use our API to query our database with past parameters. 2 00:00:06,930 --> 00:00:11,220 ‫So we are going to be passing a parameter here in this parameter, of course, is going to be coming 3 00:00:11,220 --> 00:00:14,550 ‫from other application that is consuming this API. 4 00:00:14,910 --> 00:00:17,370 ‫So this parameter may be coming from your mobile app. 5 00:00:17,790 --> 00:00:24,900 ‫This may be coming from you are front end application, but we will react or whatever technology you 6 00:00:24,900 --> 00:00:26,880 ‫are using, you receive that parameter here. 7 00:00:26,880 --> 00:00:28,640 ‫It can be even more than one parameter. 8 00:00:28,770 --> 00:00:36,210 ‫And then you query, you run, you are you are you a database using that parameter? 9 00:00:36,450 --> 00:00:45,180 ‫And therefore, let's assume that you want to query the items, all the items we maybe the item group 10 00:00:45,180 --> 00:00:45,750 ‫is obviously. 11 00:00:45,750 --> 00:00:47,940 ‫So I'm doing this for the purpose of this demo only. 12 00:00:48,570 --> 00:00:52,530 ‫So what do you do in your API is you just apply. 13 00:00:52,570 --> 00:00:56,000 ‫Remember, this is this is this is Mănescu elsewhere. 14 00:00:56,790 --> 00:01:06,090 ‫I do it in group EQUASS and then you put this and you have Cybex. 15 00:01:06,090 --> 00:01:07,730 ‫I just hope I got it in group. 16 00:01:07,740 --> 00:01:08,100 ‫Right. 17 00:01:08,560 --> 00:01:10,310 ‫It's going to tell us if it is wrong. 18 00:01:10,530 --> 00:01:16,430 ‫So I have just added from that we are idam group equal services. 19 00:01:16,440 --> 00:01:22,770 ‫Let us send this is not supposed to have any chance now because this idea is a service so sent and a 20 00:01:22,770 --> 00:01:27,350 ‫business telling us that of course, no, it has given us the other status quo to fund it. 21 00:01:27,360 --> 00:01:33,000 ‫And they see the item you're looking for is not formulators you would have supplied here. 22 00:01:34,470 --> 00:01:37,830 ‫And yes, because I have written services. 23 00:01:37,830 --> 00:01:42,780 ‫So this is not going to be found so easy are the ACA services. 24 00:01:43,170 --> 00:01:51,030 ‫And now when I send this, you see that we are getting our status out of 200 and the body of our item. 25 00:01:51,390 --> 00:01:59,370 ‫And like like you have seen our what we did here to change the status code in the previous letter was 26 00:01:59,670 --> 00:02:02,190 ‫so we misspelled the services here. 27 00:02:03,870 --> 00:02:05,490 ‫We misspelled their services here. 28 00:02:05,970 --> 00:02:09,540 ‫Let me see where they can bring this sort of is more readable. 29 00:02:12,150 --> 00:02:13,500 ‫So select. 30 00:02:18,540 --> 00:02:19,500 ‫Said do somebody. 31 00:02:22,750 --> 00:02:28,860 ‫Let me get this up, back up so you confirm it is working years. 32 00:02:28,870 --> 00:02:30,440 ‫So this one is a bit reasonable. 33 00:02:30,820 --> 00:02:36,790 ‫So now we have a select name, item and description from table items. 34 00:02:37,210 --> 00:02:40,270 ‫We are item group equals services. 35 00:02:40,280 --> 00:02:44,200 ‫So if we add something here, like, okay, so this doesn't exist. 36 00:02:44,200 --> 00:02:46,720 ‫So there's no item group with this in the database. 37 00:02:47,080 --> 00:02:50,020 ‫And we send we see that the status is changing. 38 00:02:50,020 --> 00:02:56,420 ‫So the status quo is going to 400 and the body is the item you are looking for is not found. 39 00:02:56,540 --> 00:02:56,870 ‫Right. 40 00:02:57,940 --> 00:03:03,760 ‫So when we get this back now we get our items and note that the message here is going to change. 41 00:03:03,770 --> 00:03:06,140 ‫So an incentive is this is a message. 42 00:03:06,160 --> 00:03:09,670 ‫There's a status quo out of 200 and there is this one. 43 00:03:09,700 --> 00:03:10,090 ‫All right. 44 00:03:10,600 --> 00:03:11,140 ‫Perfect. 45 00:03:12,190 --> 00:03:17,770 ‫Now, the next thing I would like us to do, not not you are not going to be hard coding these services 46 00:03:17,770 --> 00:03:18,020 ‫here. 47 00:03:18,520 --> 00:03:23,090 ‫This obviously is going to be received probably from another application out there. 48 00:03:23,350 --> 00:03:25,980 ‫So what do you want to do again, to pass it here as a parameter? 49 00:03:26,440 --> 00:03:36,820 ‫And for now, I can just I can I can I can do maybe let me hardcoded fast Appia so I can see, think, 50 00:03:37,960 --> 00:03:43,730 ‫underscore group and then I see our group. 51 00:03:43,750 --> 00:03:51,220 ‫Let me just the group because then I see services and then I pick this group and instead of doing this 52 00:03:51,220 --> 00:03:55,080 ‫now I'm going to do that and we're the best group there. 53 00:03:55,420 --> 00:04:01,120 ‫And since no you are, you are using a variable inside of this query you are going to supply our formatted 54 00:04:01,120 --> 00:04:01,710 ‫stream. 55 00:04:01,720 --> 00:04:07,780 ‫So you put an IV at the front of this query and you realize that this one has changed. 56 00:04:07,990 --> 00:04:09,240 ‫The color of this thing has changed. 57 00:04:09,260 --> 00:04:14,110 ‫You see, it was this color before when you apply and if it is changing because this is a formatted 58 00:04:14,110 --> 00:04:14,440 ‫string. 59 00:04:14,440 --> 00:04:15,320 ‫So don't forget that. 60 00:04:15,850 --> 00:04:21,640 ‫So when you said this is supposed to work us where you are and now let's assume that we want to get 61 00:04:21,640 --> 00:04:27,250 ‫this from our front end application, so we need to remove this and now we can take this and pass it 62 00:04:27,250 --> 00:04:28,240 ‫as a parameter here. 63 00:04:28,930 --> 00:04:34,960 ‫And then what you're going to do is we are going to be receiving this from our API, from our front 64 00:04:34,960 --> 00:04:37,600 ‫end application, and therefore we come to postwoman. 65 00:04:37,780 --> 00:04:42,430 ‫And we are going to be doing here just for the purpose of this test is we are going to supply our form, 66 00:04:42,430 --> 00:04:47,940 ‫data is going to be group, and then here we pass, obviously. 67 00:04:47,950 --> 00:04:51,030 ‫So when we send this, we are supposed to get the same result. 68 00:04:51,040 --> 00:04:51,990 ‫And I think it's supposed to change. 69 00:04:52,000 --> 00:04:53,830 ‫And yes, you're getting the same result. 70 00:04:54,220 --> 00:05:00,340 ‫If we pass on if at the end of this we're going to get to the item is not found because there's no service 71 00:05:00,340 --> 00:05:06,820 ‫with this, with this, with the name of the service F. 72 00:05:06,820 --> 00:05:07,270 ‫Right. 73 00:05:07,720 --> 00:05:08,890 ‫So that's not found. 74 00:05:09,040 --> 00:05:12,340 ‫And when we pass that correctly, we get our item back. 75 00:05:12,350 --> 00:05:19,840 ‫So what we have done here, just to recap, is we have passed the parameter to our function and then 76 00:05:19,840 --> 00:05:22,990 ‫we have used that parameter to query our database and return. 77 00:05:22,990 --> 00:05:28,060 ‫Additionally, of course, doing are making all these checks and then returning a response and then 78 00:05:28,060 --> 00:05:32,140 ‫on our front end, of course, this is not going to be passed from the front end application. 79 00:05:32,560 --> 00:05:37,180 ‫We have the key of group which is expected on the API here. 80 00:05:38,650 --> 00:05:43,630 ‫And then we have our the the value, which is Tavis's. 81 00:05:43,700 --> 00:05:44,070 ‫Right. 82 00:05:44,380 --> 00:05:49,230 ‫So now how this is going to work is when you want to query, for instance, is are such you are doing 83 00:05:49,240 --> 00:05:50,080 ‫on your application. 84 00:05:50,500 --> 00:05:55,780 ‫When you want to search all the items which are services, you're going to supply a group of services 85 00:05:56,050 --> 00:06:01,000 ‫if you want to submit to to query all the items, which may be something else like this. 86 00:06:01,000 --> 00:06:03,860 ‫Jack GRB next here quickly and see what they have. 87 00:06:04,810 --> 00:06:07,490 ‫So item by item list. 88 00:06:07,810 --> 00:06:14,500 ‫So if I am to add another item here, maybe the code, of course. 89 00:06:14,500 --> 00:06:22,090 ‫And this is because the programmers cause. 90 00:06:25,230 --> 00:06:32,970 ‫Programmers, OK, programmers, cause why is this writing programmers? 91 00:06:33,360 --> 00:06:41,130 ‫Oh, this is from Gramma's p r o g r programmers cause and then the item group. 92 00:06:41,370 --> 00:06:45,750 ‫Yeah this one really let us change it to something like product. 93 00:06:45,760 --> 00:06:49,570 ‫OK, and then they give the unit of measurement. 94 00:06:49,670 --> 00:06:51,950 ‫So you see the notice one of the item group is products. 95 00:06:51,950 --> 00:06:53,390 ‫So send it in. 96 00:06:53,400 --> 00:06:54,810 ‫Now here you have two items. 97 00:06:55,110 --> 00:06:59,360 ‫We are one has an item group of products and they are as item group of services. 98 00:06:59,730 --> 00:07:06,330 ‫So if from your API send this again, you see this one as returned one result. 99 00:07:06,330 --> 00:07:15,540 ‫And this is because our item here is only getting our API is only getting items where the item group 100 00:07:15,900 --> 00:07:19,020 ‫is, is whatever we are passing from our API here. 101 00:07:19,020 --> 00:07:24,240 ‫In this case, it's obviously so if we didn't use two products, I hope I'm getting that right. 102 00:07:24,750 --> 00:07:26,940 ‫Check this and see that it is going to change. 103 00:07:27,270 --> 00:07:27,950 ‫Send it. 104 00:07:28,350 --> 00:07:32,280 ‫And yes, this one I think to our cost in the program, of course, in all this. 105 00:07:32,300 --> 00:07:36,680 ‫So that is how you do it and see you in the next next year.